package com.cyy.base.exception;

/**
 * @author cyy
 * @date 2025/1/19
 * @description LearningException 自定义异常类型
 */
public class LearningException extends RuntimeException{
    private String errMessage;

    public LearningException() {
        super();
    }

    public LearningException(String errMessage) {
        super(errMessage);
        this.errMessage = errMessage;
    }

    public static void cast(CommonError commonError){
        throw new LearningException(commonError.getErrMessage());
    }

    public static void cast(String errMessage){
        throw new LearningException(errMessage);
    }

    public String getErrMessage() {
        return errMessage;
    }
}
